#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct data
{
	char * name;
	int age;
}student;


student * stu_create(char * name, int age)
{
	student * stu = (student *)malloc(sizeof(student));

	stu->name = name;
	stu->age = age;

	return stu;
}

void stu_release(student * stu)
{
	free(stu);
}

int main()
{
	char * name = "abc";
	student * stu = stu_create(name, 10);
	char * tmp = stu->name;

	printf("%s %d\n", stu->name, stu->age);	// abc 10

	printf("%p\n", name);		// 0x400794		都在栈上
	printf("%p\n", stu->name);	// 0x400794		都在栈上

	stu_release(stu);
	stu = NULL;

	printf("%s\n", tmp);	// abc

	return 0;
}
